package easy;

public class Solution_1796 {

    public int secondHighest(String s) {
        char a = '/', b = '/';
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            if (c >= '0' && c <= '9') {
                if (c > a) {
                    b = a;
                    a = c;
                } else if (c != a && c > b) {
                    b = c;
                }
            }
        }
        return b == '/' || a == b ? -1 : (b - '0');
    }

    public static void main(String[] args) {
        Solution_1796 model = new Solution_1796();
        System.out.println(model.secondHighest("ck077"));
    }
}
